# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Maintainer: Jan de Groot <jan@archlinux.org>

pkgname=gnome-desktop
pkgver=3.30.1
pkgrel=1
epoch=1
pkgdesc="Library with common API for various GNOME modules"
url="https://gitlab.gnome.org/GNOME/gnome-desktop"
arch=(x86_64)
license=(GPL LGPL)
depends=(gsettings-desktop-schemas gtk3 libxkbfile xkeyboard-config iso-codes libseccomp bubblewrap)
makedepends=(gobject-introspection git autoconf-archive gtk-doc yelp-tools)
_commit=82cd85e8e0fba88acfa203832fa0b123ee2f2d04  # tags/3.30.1^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-desktop.git#commit=$_commit"
        bwrap-var.diff)
sha256sums=('SKIP'
            'f45d72715ff4893d71b186f5f547a7c466dbe9c6db097be28d32667c73bdee73')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../bwrap-var.diff  # evince-thumbnailer needs fontconfig cache
  gtkdocize
  autoreconf -fvi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --disable-static --enable-gtk-doc \
    --with-gnome-distributor="Arch Linux®" --enable-compile-warnings=yes
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
